var addDiv = '';

function getScan() {
    $.ajax({
        url: rootPath + '/ScanController/getScan',
        contentType: 'application/x-www-form-urlencoded',
        type: 'post',
        success: function (result) {
            addDiv += '<div class="div2">' +
                '            总访问量:<label class="lable1">' + result.count + '次</label>' +
                '       </div>' +
                '       <div class="div2">' +
                '            上月访问量:<label class="lable1" id="year">' + result.lastMonth + '次</label>' +
                '       </div>' +
                '        <div class="div2">' +
                '            本月访问量:<label class="lable1" id="months">' + result.month + '次</label>' +
                '        </div>' +
                '        <div class="div2">' +
                '            今日访问量:<label class="lable1" id="day">' + result.day + '</label>' +
                '        </div>';
            $('.div1').html(addDiv);
        }
    })
}

function times(now) {
    var year = now.getFullYear(); //得到年份
    var month = now.getMonth();//得到月份
    var date = now.getDate();//得到日期
    month = month + 1;
    if (month < 10) month = "0" + month;
    if (date < 10) date = "0" + date;
    var time = "";
    time = year + "-" + month;
    return time;
}
